<?
load_model('Common');
class topic extends Common {
	protected $_name ="topic";
	protected $_primary = 'top_id';
	
	public function get_topic_list(){
		$arr = $this->fetchAll(null,"top_id asc")->toArray();
		return $arr;
	}
	
	function add_topic($data){
		$dataInsert = array(
		    'top_id' => $data['top_id'],
		    'top_name' => $data['top_name'],
		);
		return $this->insert($dataInsert);
	}
	
	function update_topic($id, $data){
		$db = $this->getAdapter();
		$where = $db->quoteInto('top_id = ?', $id);
		return $this->update($data, $where);
	}
	
	
}

?>